Praise be to Allah.
There is nothing wrong with using contraceptives when there is a need to do so, if that is with the permission of the husband and under medical supervision. For more information, please see the answer to questions no. 32479 and 21169.
If the monthly periods have stopped because of taking those pills or for some other reason, the woman is deemed to be in a state of purity, so she can do everything that women who are in a state of purity do, such as fasting, praying, and sitting in the mosque, because all of these things are only disallowed because of the menstrual blood. If she is not bleeding, then the prohibition does not apply and she may do whatever women who are in a state of purity do. This is indicated by the words of the Prophet (blessings and peace of Allah be upon him) to the woman who was suffering from istihaadah (irregular, non-menstrual bleeding): “If it is menstrual blood, it is dark and recognisable; when it is like that, then refrain from praying, and when it is the other type, then do wudoo’ and pray.” Narrated by Abu Dawood (304); classed as saheeh by Shaykh al-Albaani
It says in al-Mawsoo‘ah al-Fiqhiyyah (18/327): The Hanbalis clearly stated that it is permissible for a woman to take permissible kinds of medicine in order to stop menses, if it is free of harmful effects; that is subject to the husband's permission, because he has a right to have a child. Maalik regarded it as makrooh, lest the woman cause harm to her body by doing that. … If the woman takes medicine and her periods stop, then she is deemed to be in a state of purity. End quote.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: If she takes something to prevent menses, and she does not have a period, then she should carry on praying and fasting, and not break the fast and make it up later, because she is not menstruating. The ruling is connected to the reason. Allah, may He be glorified and exalted, says (interpretation of the meaning):
“They ask you concerning menstruation. Say: that is an Adha (a harmful thing for a husband to have a sexual intercourse with his wife while she is having her menses), therefore keep away from women during menses and go not unto them till they have purified (from menses and have taken a bath). And when they have purified themselves, then go in unto them as Allah has ordained for you (go in unto them in any manner as long as it is in their vagina). Truly, Allah loves those who turn unto Him in repentance and loves those who purify themselves (by taking a bath and cleaning and washing thoroughly their private parts, bodies, for their prayers, etc.)”
When this harmful thing is present, the rulings on it are applicable; when it is not present, the rulings are not applicable.
End quote from Majmoo‘ al-Fataawa, 19/260
And Allah knows best.