Try taking out the battery and SIM and leave out for a few minutes. In the mean time clean the contacts on both using an eraser you would use in school, then replace them. See if that works. If not, you may have to try a master reset, which means you'll lose any data you have in the phone so I'd advise copying any pictures, messages etc before doing so and back up your phone to the memory card as this will save contacts etc but remember to take the memory card out before resetting the phone