G7 leaders vow to back Ukraine "for as long as it takes"