Relaxation of variational functionals with piecewise constant growth conditions