Many industries, such as microelectronics and power electronics, face challenges in removing large amounts of heat from small areas to prevent overheating. Recent research has shown that microchannel flow of ferrofluids driven by an external magnetic field (MF) has the potential to deliver efficient cooling systems for modern electronics. Despite this potential, robust optimisation of the MF has not been undertaken. This paper addresses this shortcoming by reporting the effect of the MF produced by three permanent magnets in various configurations on the heat transfer of ferrofluids undergoing laminar flow through a microchannel under constant heat flux boundary conditions at Peclét number Pe=73. Observations from numerical simulation show that the rate of convective heat transfer varies strongly with position and orientation of the magnets. We show that for the optimum magnet configuration, the maximum and average Nusselt numbers increase by more than 146% and 51% over the unperturbed flow, some of the highest values reported in the literature. These results show that significantly accelerated heat transfer is possible in magnetically driven ferrofluids, with potential for further enhancement with more rigorous optimisation.