the situation that got me in this situation

I was wondering is okay to have sex while pregnant, is there any harm to it? My boyfriend is afraid it'll hurt the baby but I haven't thought much about it?