Space Telescope and optical reverberation mapping project. XII. Broad-line region modeling of NGC 5548