Multiscale technique for nonlinear analysis of elastoplastic and viscoplastic composites