Optimal Control of Service Quality in a Queueing System