The influence of a demagnetizing field on hysteresis losses in a dense assembly of superparamagnetic nanoparticles