Miconazole nitrate?

Is this treatment safe to use while pregnant to cure a yeast infection ? It was prescribed by my obgyn .