sex pains during pregnancy

I'm about 21 weeks pregnant. When my husband and I have sex, I'm almost always on top. We haven't had much sex since I became pregnant, but this morning when we did have sex and I was on top.. after about two minutes of riding him, I started to get really sharp pains in my lower abdomen.. it actually felt like my skin was tearing apart? I guess I was using too much of my ab muscles? Can this be harmful to the baby?