UV and optical spectroscopy of NGC 5548