The precise engineering of quantum states, a basic prerequisite for technologies such as quantum-enhanced sensing or quantum computing, becomes more challenging with increasing dimension of the system Hilbert space. Standard preparation techniques then require a large number of operations or slow adiabatic evolution and give access to only a limited set of states. Here, we use quantum optimal control theory to overcome this problem and derive shaped radio-frequency pulses to experimentally navigate the Stark manifold of a Rydberg atom. We demonstrate that optimal control, beyond improving the fidelity of an existing protocol, also enables us to accurately generate a nonclassical superposition state that cannot be prepared with reasonable fidelity using standard techniques. Optimal control thus substantially enlarges the range of accessible states. Our joint experimental and theoretical work establishes quantum optimal control as a key tool for quantum engineering in complex Hilbert spaces.