Nonlinear metric perturbations and production of primordial black holes