welcome to helthcaremagic forum
you have not mention the method of masturbation
if you have use any object to penetrate ,there is high chance of infection
what you have right now is sign of infection and inflammation
you need to consult doctor
if you dont want than take analgesic
dont do it again for a wk .
i hope i have answered your question.