Cooling electrons by magnetic-field tuning of Andreev reflection