The vitamin is involved in the immune system and in managing calcium in the blood, which influences bone health. The body produces it when exposed to sunlight. During pregnancy, women produce higher amounts of vitamin D to help fetal bone development and are at increased risk of vitamin deficiency, according to the researchers.

"Our findings indicate women may run the risk of developing vitamin D deficiency just when they want to become pregnant," said study first author Dr. Quaker Harmon. She is a postdoctoral fellow at the U.S. National Institute of Environmental Health Sciences.

"For women who are planning to stop using birth control, it is worth taking steps to ensure that vitamin D levels are adequate while trying to conceive and during pregnancy," Harmon said in a news release from the Endocrine Society.

The study included nearly 1,700 black women in the Detroit area. Blood samples showed that those who used birth control pills, patches or rings containing estrogen had 20 percent higher vitamin D levels.

"We could not find any behavioral differences -- such as increased time spent outdoors -- to explain the increase," Harmon noted.

But women who had stopped using those birth control methods had average vitamin D levels, the investigators found.