Iphone 4 won't play music/sound but will play with headphones?

I was syncing my phone to my laptop (everything was fine before this), but when I ejected my iphone from my laptop, the sound stopped working. It will still have sounds such as alarms, voice control and that sort of thing, and I can hear it fine when I'm wearing headphones, but other than that (for instance when it's on music or an app that uses sound) it's silent.
Any ideas or suggestions would be greatly appreciated.

Have you tried turning it off and on again?

Did you mute it by accident?