Semiconductor-ferromagnetic insulator-superconductor nanowires : stray field and exchange field