I also was on pain meds when I was pregnant with my now 4 m onth old HEALTHY daughter! I was taking lorcet, soma and xanax... I immediatly started weaning off of the meds with my doctors help. He prescribed me tylenol 3 which helped but not like my normal meds. I have a ruptured disc in my L5 and S1.. Withdrawl can be viscious and it can be bad for the baby so you will have to be tapered off and hopefully your ob will give you something you can take for the pain... I was a WRECk too when I was pregnant but I assure you it will all be fine. Talk to them and get put on something not harmful to the baby so you can wean off your meds. Good luck and feel free to write me if you need anything as I know how this can be!!
The incidence of birth defects due to the medications you are on is relatively low. As you have discussed, the higher risk is for the baby to have withdrawal symptoms after birth.
You can ask your Obstetrician to either work with you to tailor your medication regimen, or give you a referral to a Pain/Sedation specialist. Although you may not be able to completely taper off pain medication, you may be able to reduce the risk or severity of withdrawal in your baby.