We consider the entanglement entropy in critical one-dimensional quantum systems with open boundary conditions. We show that the second Rényi entropy of an interval away from the boundary can be computed exactly, provided the same conformal boundary condition is applied on both sides. The result involves the annulus partition function. We compare our exact result with numerical computations for the critical quantum Ising chain with open boundary conditions. We find excellent agreement, and we analyse in detail the finite-size corrections, which are known to be much larger than for a periodic system.