The past few years have witnessed a remarkable interest in the application of quantum computing for solving problems in quantum chemistry more efficiently than classical computers allow. Very recently, proof-of-principle experimental realizations have been reported. However, so far only the nonrelativistic regime (i.e., the Schrodinger equation) has been explored, while it is well known that relativistic effects can be very important in chemistry. We present a quantum algorithm for relativistic computations of molecular energies. We show how to efficiently solve the eigenproblem of the Dirac-Coulomb Hamiltonian on a quantum computer and demonstrate the functionality of the proposed procedure by numerical simulations of computations of the spin-orbit splitting in the SbH molecule. Finally, we propose quantum circuits with three qubits and nine or ten controlled-NOT (CNOT) gates, which implement a proof-of-principle relativistic quantum chemical calculation for this molecule and might be suitable for an experimental realization.