The main purpose of this paper is to approximate the solution of the optimal control problem for systems governed by a class of nonlinear Volterra integral equations. In order to do this, we use combination of Bernstein polynomials (BPs) and block-pulse functions (BPFs) on the interval [0, 1) for converting this problem to an optimization problem that can be solved easily by mathematical programming techniques. Also, the convergence of the proposed method is discussed. Furthermore, in order to show the accuracy and reliability of the proposed method, the new approach is applied to some practical problems.