Averaging for solitons with nonlinearity management