A contrast source method for nonlinear acoustic wave fields in media with spatially inhomogeneous attenuation