In an optically absorbing or amplifying linear medium, the energy flow density of interfering optical waves is in general periodically modulated in space. This makes the wave transmission through a material boundary, as described by the Fresnel transmission coefficients, nonreciprocal and apparently violating the energy conservation law. The modulation has been previously described in connection to ordinary homogeneous nonmagnetic materials. In this work, we extend the description to nanomaterials with designed structural units that can be magnetic at optical frequencies. We find that in such a "metamaterial" the modulation in energy flow can be used to enhance optical far-field emission in spite of the fact that the material is highly absorbing. We also demonstrate a nanomaterial design that absorbs light, but simultaneously eliminates the power flow modulation and returns the reciprocity, which is impossible to achieve with a nonmagnetic material. We anticipate that these unusual optical effects can be used to increase the efficiency of nanostructured light emitters and absorbers, such as light-emitting diodes and solar cells.