A former vicar who raped a six-year-old boy in his church has been sentenced to life in prison.