Too much coffee can reduce the chances of a woman with fertility problems getting pregnant, a study suggests.