A numerical method is presented for Runge-Kutta discretization of unconstrained optimal control problems. First, general Runge-Kutta discretization is carried out to obtain a finite-dimensional approximation of the continous-time optimal control problem. Then a recent optimization technique, the inexact restoration (IR) method, due to Martinez and coworkers [E. G. Birgin and J. M. Martinez, J. Optim. Theory Appl., 127 (2005), pp. 229-247; J. M. Martinez and E. A. Pilotta, J. Optim. Theory Appl., 104 (2000), pp. 135-163; J. M. Martinez, J. Optim. Theory Appl., 111 (2001), pp. 39-58], is applied to the discretized problem to find an approximate solution. It is proved that, for optimal control problems, a key sufficiency condition for convergence of the IR method is readily satisfied. Under reasonable assumptions, the IR method for optimal control problems is shown to converge to a solution of the discretized problem. Convergence of a solution of the discretized problem to a solution of the continuous-time problem is also shown. It turns out that optimality phase equations of the IR method emanate from an associated Hamiltonian system, and so general Runge-Kutta discretization induces a symplectic partitioned Runge-Kutta scheme. A computational algorithm is described, and numerical experiments are made to demonstrate the working of the method for optimal control of the van der Pol system, employing the three-stage (order 6) Gauss-Legendre discretization.