Having sex on top while laying down is it safe during pregnancy?

Gabriela • First time mom. 23. Due 06.26.17
Last night I was having intercourse with my husband, and I started to have cramping :( 
Is this normal, or am I not suppose to be laying on him on top? 
What are safe sex positions?
Thanks!