Hold down the sleep/power button and the home button for ten seconds, release the power button wait 12 seconds. Your iPhone will be in DFU mode. Ignore whatever the iPhone's screen does, once you're in DFU mode the iPhone will appear to be off. iTunes will then see the iPhone and prompt you to restore it.
Note: Getting into DFU mode is tricky. It may take you a few tries before you get there.