There could be several reasons for the pain. Apart from the oddness of the position, you should also rule out any pelvic infection
, retroverted position of the uterus
with prolapsed ovaries and cysts. You should see your gynecologist for any pelvic pathology that is responsible for the pain. If there is none, you may rest assured and practise safe intercourse. Take care.