If this is a new thing to you, i.e not done it during masterbation or sex before, then it will be sore. I too am uncercumcized and my foreskin pulls back quite naturaly during sex now, though it hurt like a mother to start with. The more it happens the, less it hurts. It even hightens the pleasure when you get used to it.
I think this is normal mate usually happens from masturbation. If it still hurts then look into it(but I think it is normal for it to be a little raw for short period of time) Did foreskin rip away from the head of the penis because this happened to me when i was younger? Can you now pull your foreskin all the way back or is some of it still attached? Being able to pull your foreskin back fully is normal.