The variational cluster approximation (VCA) proposed by M. Potthoff et al. [Phys. Rev. Lett. 91, 206402 (2003)] is extended to electron or spin systems with nonlocal interactions. By introducing more than one source field in the action and employing the Legendre transformation, we derive a generalized self-energy functional with stationary properties. Applying this functional to a proper reference system, we construct the extended VCA (EVCA). In the limit of continuous degrees of freedom for the reference system, EVCA can recover the cluster extension of the extended dynamical mean-field theory (EDMFT). For a system with correlated hopping, the EVCA recovers the cluster extension of the dynamical mean-field theory for correlated hopping. Using a discrete reference system composed of decoupled three-site single impurities, we test the theory for the extended Hubbard model. Quantitatively good results as compared with EDMFT are obtained. We also propose VCA (EVCA) based on clusters with periodic boundary conditions. It has the (extended) dynamical cluster approximation as the continuous limit. A number of related issues are discussed.