The Vatican has given the green light for gay men to become priests - as long as they remain celibate.