Stress can certainly affect the quality of the erection. Organic causes can include a low testosterone level, or various metabolic diseases including diabetes.
I would suggest an examination by your physician to evaluate pulses to ensure it is not a bloody supply problem. A total testosterone level should be obtained as well as a test for diabetes.
If these tests are negative, discussion of whether Viagra can be considered. If stress is determined to play a role in your symptoms this should be appropriately addressed.
Followup with your personal physician is essential.
This answer is not intended as and does not substitute for medical advice - the information presented is for patient education only. Please see your personal physician for further evaluation of your individual case.
Thanks,
Kevin, M.D.