Linear stability of a steady convective flow in a vertical fluid layer is investigated. The base flow is generated by internal heat sources of non-uniform density. Transverse magnetic field is applied in the direction perpendicular to the boundaries of the fluid layer. The problem is relevant to the design of liquid blankets of nuclear reactors since neutron irradiation results in volumetric heating of the flow. Calculations are performed for two typical liquids suggested for the blankets (liquid metals and FliBe). It is shown that non-uniformity of internal heat sources destabilizes the flow while the increase of the strength of the magnetic field has a stabilizing influence. Two different instability modes are found for large Prandtl numbers.