Optimal control of strong-field ionization with time-dependent density-functional theory