Rafael Benítez agrees to stay as Newcastle manager