Thanks for your query.Based on the facts that you have posted it appears that you have Epididymo Orchitis
on Rt. side. Though you have taken antibiotics for five days and your pain has subsided it takes 3-4 weeks for Orchitis to get resolved completely.
The erectile problem that you are facing may be the result of the infection. Please consult qualified Urologist
for clinical examination and further advice. He may advise you to get some tests like Ultrasound
Scanning and colour Doppler study of the scrotum
done.to confirm the diagnosis In the mean while continue taking antibiotic .