It is probably psychological. You're more than likely subconsciously associating sex with pain and very likely with guilt for perhaps having given it to your wife (or anger for having gotten it from her?)
I can only imagine the chlamydia infections have created tension between you and your wife. Add to the fact that you have a new baby in the house and I can understand why you are having difficulty obtaining an erection.
I would try direct and honest discussion between your wife and yourself. Perhaps this will remove the fear, guilt, anger, confusion you are (and your wife) may be feeling.
If the problem persists I would pursue counseling for you and your wife.
Good luck, you're in a tough spot but I'm sure through time and discussion you and your wife can move on happily.