Agreement comes after Wellington halted millions in aid to its former colony after Cook Islands formed strategic partnership with Beijing