Well, that explains why you don't have any audio through your external speakers. Now we just need to figure out how to restore it.
I first suggest resetting the PRAM by restarting your iMac while holding down the command-option-P-R keys until you hear the system restart tone two times. If there is a corrupted parameter then this will resolve the issue. You can read about the PRAM reset here:
http://support.apple.com/kb/HT1379
If the issue still occurs, try unplugging and reconnecting the speakers from the audio OUT connector.
If you still cannot get it to work check to make sure that you have the correct 3.5mm connector on the cable that you are using to connect the speakers to your iMac. You probably do, but it's worth checking. If you have another device you can plug the speakers into (iPhone, iPod, another computer, etc) I suggest verifying that they work properly on other devices.
If you still have problems then you may need to contact the place where you purchased the iMac. If you purchased within the last couple of weeks you may be able to exchange the system.