IUD question—TMI

I forgot to ask my doctor this and I don’t want to do it unless I’m completely sure but...can a guy cum inside you while you have your IUD and not get pregnant? I know it’s one of the highest rated birth controls as far as effectiveness goes. I just don’t want to have to risk it just because I forgot to ask.