Sex has been known to cause contractions, it has for me but just Braxton hicks but it was the only time they were painful. Back pain could also be from the Braxton hicks. Did you take Tylenol for your headache? They are only usually worried about if they don't go away with Tylenol or if your also "seeing stars". Not ever a bad idea to call your dr, but I wouldn't say go to the hospital or anything unless these symptoms don't go away
Sex is not supposed to make you feel miserable.
I would call your dr! Your so close to having your baby its better not to ignore signs like that