We present an algorithm that extends existing quantum algorithms for simulating fermion systems in quantum chemistry and condensed matter physics to include bosons in general and phonons in particular. We introduce a qubit representation for the low-energy subspace of phonons which allows an efficient simulation of the evolution operator of the electron-phonon systems. As a consequence of the Nyquist-Shannon sampling theorem, the phonons are represented with exponential accuracy on a discretized Hilbert space with a size that increases linearly with the cutoff of the maximum phonon number. The additional number of qubits required by the presence of phonons scales linearly with the size of the system. The additional circuit depth is constant for systems with finite-range electron-phonon and phonon-phonon interactions and linear for long-range electron-phonon interactions. Our algorithm for a Holstein polaron problem was implemented on an Atos Quantum Learning Machine (QLM) quantum simulator employing the Quantum Phase Estimation method. The energy and the phonon number distribution of the polaron state agree with exact diagonalization results for weak, intermediate and strong electron-phonon coupling regimes.