Basically, my wife and I plan to have a baby, but it's not happening. I went to a doctor, and they said that it's more likely to happen during her period. I know that in Islam it is haram to have sex with the wife when she is in her period. What can we do?
There is no overall benefit in anything that is haram. Avoid anything that is not permissible:
ذَٰلِكَ وَمَن يُعَظِّمْ حُرُمَاتِ اللَّهِ فَهُوَ خَيْرٌ لَّهُ عِندَ رَبِّهِ ۗ وَأُحِلَّتْ لَكُمُ الْأَنْعَامُ إِلَّا مَا يُتْلَىٰ عَلَيْكُمْ ۖ فَاجْتَنِبُوا الرِّجْسَ مِنَ الْأَوْثَانِ وَاجْتَنِبُوا قَوْلَ الزُّورِ
That [has been commanded], and whoever honors the sacred ordinances of Allah - it is best for him in the sight of his Lord. And permitted to you are the grazing livestock, except what is recited to you. So avoid the uncleanliness of idols and avoid false statement,
You should seriously consider switching to another doctor. From a medical point of view, ovulation is the most fertile time in a menstrual cycle, i.e., when a woman is most likely to conceive. According to the American Pregnancy Association, this is typically on the 14th day from the onset of the menstrual cycle (refer to their ovulation calendar to help you decide which days are her most fertile days). WebMD also provides a similar ovulation calculator.
As you pointed out, from an Islamic point of view, regardless of what the reasons or conditions may be, men are not allowed to approach their wives until they are pure:
وَيَسْأَلُونَكَ عَنِ الْمَحِيضِ ۖ قُلْ هُوَ أَذًى فَاعْتَزِلُوا النِّسَاءَ فِي الْمَحِيضِ ۖ وَلَا تَقْرَبُوهُنَّ حَتَّىٰ يَطْهُرْنَ ۖ فَإِذَا تَطَهَّرْنَ فَأْتُوهُنَّ مِنْ حَيْثُ أَمَرَكُمُ اللَّهُ ۚ إِنَّ اللَّهَ يُحِبُّ التَّوَّابِينَ وَيُحِبُّ الْمُتَطَهِّرِينَ
And they ask you about menstruation. Say, "It is harm, so keep away from wives during menstruation. And do not approach them until they are pure. And when they have purified themselves, then come to them from where Allah has ordained for you. Indeed, Allah loves those who are constantly repentant and loves those who purify themselves."
Therefore, having sexual intercourse during menstruation is strictly forbidden.
NOTE. The interpretation of the avoidance of approach in the verse above is to be taken within the context of the reason of its revelation:
عن أنس أن اليهود كانوا لا يجلسون مع الحائض في بيت ولا يأكلون ولا يشربون قال فذكر ذلك للنبي صلى الله عليه وسلم فأنزل الله ويسألونك عن المحيض قل هو أذى فاعتزلوا النساء في المحيض فقال رسول الله صلى الله عليه وسلم اصنعوا كل شيء إلا الجماع
It was narrated by Anas that: The Jews would not sit with a menstruating woman in a house, nor eat with her, nor drink with her. That was mentioned to the Messenger of Allah, then Allah revealed the words: "They ask you concerning menstruation. Say: that is a harmful thing, therefore keep away from women during menses." The Messenger of Allah said: "Do everything except sexual intercourse."
To avoid approaching one's wife is limited to sexual intercourse. Some scholars allow approaching without an izar (clothing that wraps around the lower part of the body down to the knees), but most scholars mandate that the wife wears an izar based on the Sunnah of the Prophet ﷺ with his wives:
عن عبد الرحمن بن الأسود عن أبيه عن عائشة قالت كانت إحدانا إذا كانت حائضا فأراد رسول الله صلى الله عليه وسلم أن يباشرها أمرها أن تتزر في فور حيضتها ثم يباشرها قالت وأيكم يملك إربه كما كان النبي صلى الله عليه وسلم يملك إربه تابعه خالد وجرير عن الشيباني
Narrated 'Abdur-Rahman ibn Al-Aswad (on the authority of his father): 'Aisha said: "Whenever Allah's Messenger (ﷺ) wanted to fondle anyone of us during her period (menses), he used to order her to put on an izar and start fondling her." 'Aisha added, "None of you could control his sexual desires as the Prophet (ﷺ) could."
And another similar hadith:
عن ميمونة قالت: كان رسول الله صلى الله عليه وسلم يباشر نساءه فوق الإزار وهن حيض
Maimuna (the wife of the Holy Prophet) reported: The Messenger of Allah (ﷺ) contacted and embraced his wives over the waist-wrapper when they were menstruating.