Hurting after sex?

So me and my boyfriend had sex last night and now it hurts when I use the restroom and when I wipe there like blood like if I just about to start my period. Can someone please explain why this is happening?