The UK economy would be hit by leaving the EU, but the impact would be "small" and unlikely to lead to big job losses, according to credit agency Moody's.