Prince Harry, the Duke of Sussex, has agreed to settle a lawsuit against a UK newspaper group over alleged phone hacking.