New Zealand has agreed to pay $3.6 million in compensation to Samoa a year after a after a navy ship ran aground on a reef.