Initial boundary value problems and optimal control for nonautonomous parabolic systems