This work studies the feasibility of optimal control of high-fidelity quantum gates in a model of interacting two-level particles. One set of particles serves as the quantum information processor, whose evolution is controlled by a time-dependent external field. The other particles are not directly controlled and serve as an effective environment, coupling to which is the source of decoherence. The control objective is to generate target one- and two-qubit gates in the presence of strong environmentally-induced decoherence and physically motivated restrictions on the control field. The quantum-gate fidelity, expressed in terms of a state-independent distance measure, is maximized with respect to the control field using combined genetic and gradient algorithms. The resulting high-fidelity gates demonstrate the utility of optimal control for precise management of quantum dynamics, especially when the system complexity is exacerbated by environmental coupling.