It's common for opiates to decrease sexual desire and even have effects on erections. They do this by decreasing testosterone production and increasing prolactin, among other ways, but those are generally the main culprits agreed upon, based on what I've heard. If you're curious, do a search either here or with Google. Plenty information out there.
How do you fix it? Well, you could try some sort of impotence pill, try to work out, or hell even take extra testosterone. Keep in mind that things such as viagra won't really increase your libido.
The easiest and best way would be to lower your opiate intake.