Active control of the spatial MRI phase distribution with optimal control theory