The change, opposed by the Catholic church, will come into force at the start of the new school year in September.