Man United agree deal for Fernandes