Relaxation of nonconvex variational problems