Could be any number of things. What user trobleshooting have you tried? Restart (power off/on) reset, hold the sleep/wake and home buttons together until you see the Apple logo and then release. See if it works after the phone restarts. Next is a restore from a backup (make sure you made a current one), then restore as a new device, which deletes all data from your device. If it doesn't work after all that, then make an appointment at the Genius Bar at the local Apple store, it is probably a hardware issue.
I have seen something similar which is generally diagnosed as a hardware issue.