Hi,
I'd agree with your surgeon. It's unlikely your pelvic nerves were affected during the surgery or the liver infection, as the nerves in this area don't travel to the penis.
Are you diabetic? This can sometimes have an effect on nerve function, and diabetics can have neuropathy, which causes nerve dysfunction.
Another possible cause is this could be a delayed complication of the
vasectomy. If an MRI showed no issues, than it could simply be due to primary
erectile dysfunction.
Another possibility is Leriche syndrome -in which patients get leg pain, buttock pain, and
impotence. This is due blockages in the internal iliac arteries, which give blood supply to the pelvis. A CT Angiogram would help diagnose this. (MRI would not show any potential blood supply symptoms). This would particularly be a problem if you have a history of
high blood pressure, coronary artery disease, or any
smoking.
I hope these other ideas are helpful. Please let me know if you have any further questions.