Metro Bank has agreed the sale of its £584million portfolio of personal loans.