It doesn't seem like the button is the issue, since it still works when you have headphones plugged in the. Try rebooting your device by holding the home and power buttons at the same time until the Apple logo appears. This usually works on these quirky issues.