"Heat" and "light" are perceptual classifications of radiated energy, and they don't really give one the correct intuition for scientific physical understanding of radiated energy. "Heat" and "light" (visible) are bands of radiated energy (or wavelengths) in the electro-magnetic (EM) spectrum. The only difference between light and heat is energy level / wave length.
All materials reflect and absorb different sections of the EM spectra, i.e. they have different absorption properties. Black paint obviously absorbs in the visible band but it also absorbs down into infrared (IR) or "heat" wavelengths. In the case of an engine block/heads energy is absorbed (into the steel) from combustion and emitted as IR EM. Lighter colored or metallic paints (that don't absorb down into the IR wavelengths) reflect this energy back into the engine, where as black paint will absorb the infrared EM radiation and emit it into the air, i.e. it will reflect much less of it back into the engine material. The black paint will emit the energy into the air and back into the engine, but the engine (steel) will reflect most of it back into the paint, so the net effect is that more IR radiation (heat) will be pulled from the engine by the black paint. It's pretty simple freshmen physics.