I read this story as a teenager. It was about a dystopian future where people lived in buildings with contraceptive gas. When they got permission to become parents, they would leave the city. The prospective parents would live without the contraceptive gas until an egg and a sperm would be harvested from the couple and placed in an artificial womb.
Might this be The Eyes of Heisenberg by Frank Herbert, originally published in 1966?
A New World in Embryo
Public Law 10927 was clear and direct. Parents were permitted to watch the genetic alterations of their gametes by skilled surgeons . . . only no one ever requested it.
When Lizbeth and Harvey Durant decided to invoke the Law; when Dr. Potter did not rearrange the most unusual genetic structure of their future son, barely an embryo growing in the State's special vat-the consequences of these decisions threatened to be catastrophic.
For never before had anyone dared defy the Rulers' decrees . . . and if They found out, it was well known that the price of disobedience was the extermination of the human race . . .
And here's a review from sciencefictionruminations.com which mentions the use of contraceptive gas:
The Eyes of Heisenberg (1966) is a disturbing far future vision where humans (“Folk”) are the mere pawns of two far greater powers: the Optimen — genetically superior humans able to live thousands of years — and the Cyborgs, an underground movement that extends the lifespan of the normal human by adding computers, mechanical limps, and even strange weapons that emerge as devastating protrusions from the chests of their wearers.
The Optimen keep the Folk subjugated by controlling their fertility with contraceptive gasses that are pumped throughout their cities. Also, a large percentage of the Folk population are sterile. The Optimen employs a cadre of genetic surgeons who control which Folk are able to reproduce. The embryos are housed in high-tech vats where they are subjected to “cuts” i.e. genetic manipulation. A minute amount of the embryos are found to be abnormal — these, subjected to extensive enzymatic treatments become Optimen who are virtually immortal. Unfortunately, the Optimen are sterile and thus rely on the Folk surgeons to comb the populace to find embryos suitable to be transformed into Optimen. These surgeons, who are often sterile themselves, are rewarded with enzymatic treatments that extend their lives.
One of Herbert’s central themes is the loss of identity that the Sterries, sterile Folk, undergo. Because they are unable to naturally reproduce, “They’re all people without pasts and only the hope for a future to cling to. Somewhere our past was lost in an ocean of darkness. The Optimen and their gene surgeons have extinguished our past” (40). Hence, many of them join the Cyborgs in a desperate attempt to extend their own lives.
The Optimen themselves, some whom are 40,000 years old, are transformed by their inability to reproduce and their extreme age. In Central, separate from the Folk habitations of the surrounding metropoli, they exist in almost perpetual adolescence filled with dalliance and play where terms like “death” or “degradation” and “violence” have exited their vocabulary, in part due to the fear of potential enzymatic imbalance that might result from depressing thought. With childlike glee, they “rediscover” mankind’s obsession with violence and destruction over the course of the narrative.
In this power struggle between the Optimen and the Cyborgs the Folk are mere tools. They can be duplicated by both groups, their embryos can be manipulated or destroyed on whim, they are prevented from naturally producing, and their embryos are needed to perpetuate the Optimen. However, a majority of the Folk revere the Optimen who grant their most trusted pawns extended lifespans and select certain individuals from the ranks to reproduce.
Enter Lizabeth and Harvey Durant, members of Parents Underground, an affiliate organization of the Cyborgs. They arrive at a local hospital to witness the genetic re-sequencing of their embryo. Due to the strange properties of the embryo, Potter, a high-ranking surgeon is called to oversee the operation. He discovers that the embryo contains unusual qualities, increased intelligence, full fertility (the implication is its immune to the contraceptive gas), and incredible life expectancy. However, the fetus does not contain the properties indicating an Optimen, hence, he obligated to destroy it. However, at the last moment with the assistance of a nurse, Potter destroys the record of the operation. Lizabeth and Harvey Durant (able to communicate non-verbally with each other by means of hand pressure) want to keep their child. The Optimen want to destroy the embryo. The Cyborgs want to study the embryo in order to extend their own lives. The Cyborgs implant the fetus into Lizabeth and attempt to escape to clutches of the Optimen…