Could my erectile dysfunction be caused by a recent vasectomy?

Patient: I had a vasectomy eight weeks ago during the procedure the Dr. Said the tube to be cut on the right side was deep next to a few major blood vessels.I experienced extreme pain during the procedure . Now I am having trouble maintain an erection during intercourse. Could this be a side affect of surgery ?

Doctor: