In general, when a blessing is recited on the performance of a Mitzvah, the blessing is first recited and one then performs the Mitzvah. For example, with respect to sounding the Shofar, one first recites the blessing and then one blows the Shofar. This method, based on the Gemara (Sukkah 39a), is known as “Over Le’asiatan”. There are instances in which the blessing is recited after the Mitzvah is performed for logistical, or other Halachic reasons, such as in Netilat Yadayim.
There is a discussion among the Poskim as to when a woman should recite the blessing on Shabbat candles. This is based on the debate on whether a woman accepts Shabbat upon herself when she lights the Shabbat candles. The Bahag (c.f Bet Yosef, § 263) writes that a woman accepts Shabbat when she recites the blessing over the candles. It follows that she could not light the candles after the blessing since, for her, it is already Shabbat, and therefore she would have to first light and then recite the blessing.
The Shulhan Aruch (O.H. 263:5) writes that when one lights the Shabbat candles one recites the blessing “Baruch…Lehadlik Ner Shel Shabbat”. Nornally, the Shulhan Aruch writes its ruling in the verbiage of either the Tur or the Rambam. However, the Rambam (Shabbat 5:1) writes clearly that one first recites the blessing and then lights the candles, whereas the language of the Shulhan Aruch simply says “when” someone lights one recites the blessing. Rabbi Shalom Messas (Shemesh Umagen, § 3:71) writes that although the Shulhan Aruch is vague, it seems to imply that one first lights and then recites the blessing. Furthermore, whenever the Shulhan Aruch is vague, the Halacha follows the accepted custom. As well, the Aruch Hashulhan (263:16) adds that reciting the blessing before lighting could actually be considered a blessing in vain since such a case, one says a blessing, thereby accepting Shabbat, and then one goes on to perform an act which violates Shabbat.
It is important to note that the HIDA (Mahazik Beracha 263:4) and the Ben Ish Hai (Shana II, Parashat Noach) testify that the universal Sepahrdic and Ashkenazic custom was that a women should first light, then cover the light of the candles and then one’s eyes and recite the blessing. Furthermore, Magen Avot (263:5) records that this was the custom of Tunisia, Algeria, Libya Iraq, Iran, Buchara, Egypt, Turkey and Syria.
It is well known that Rabbi Ovadia Yosef (Yabia Omer, vol. X, §21), based on the Rambam, was of the opinion that one should first recite the blessing and then light the Shabbat candles. Although the accepted custom was to first light, he cites (c/f in footnote ibid) that many great rabbis throughout the generations had the power to nullify customs.
Notwithstanding, since this custom has a strong basis in Halacha, and the blessing is said right after the lighting, it is compared to the procedure used in Netilat Yadayim. Indeed, great rabbis from Morocco were adamant about maintaining this custom just as it was practiced for centuries (c.f Shemesh Umagen ibid, Kitzur S. A Toledano §134:27, Nahagu Haam, Shabbat)
Summary: The universal custom is for the woman to first light the Shabbat candles and then recite the blessing.