Controlled-phase (cphase) gates can be realized with trapped neutral atoms by making use of the Rydberg blockade. Achieving the ultrahigh fidelities required for quantum computation with such Rydberg gates, however, is compromised by experimental inaccuracies in pulse amplitudes and timings, as well as by stray fields that cause fluctuations of the Rydberg levels. We report here a comparative study of analytic and numerical pulse sequences for the Rydberg cphase gate that specifically examines the robustness of the gate fidelity with respect to such experimental perturbations. Analytical pulse sequences of both simultaneous and stimulated Raman adiabatic passage (STIRAP) are found to be at best moderately robust under these perturbations. In contrast, optimal control theory is seen to allow generation of numerical pulses that are inherently robust within a predefined tolerance window. The resulting numerical pulse shapes display simple modulation patterns and can be rationalized in terms of an interference between distinct two-photon Rydberg excitation pathways. Pulses of such low complexity should be experimentally feasible, allowing gate fidelities of order 99.90-99.99% to be achievable under realistic experimental conditions.