EDGES signal in the presence of magnetic fields