Sex with a UTI while pregnant?

Is it safe to have sex if you have a suspected UTI while pregnant?