Yes, certain medications, such as antidepressants, antihistamines, and blood pressure medications, can have side effects that interfere with sexual function, including maintaining an erection.