World leaders at the G7 summit have pledged millions of doses of the Covid-19 vaccine to poorer countries.