At the time when this paper was written, quarantine-related strategies (from full lockdown to some relaxed preventive measures) were the only available measure to control coronavirus disease 2019 (COVID-19) epidemic. However, long-term quarantine and especially full lockdown is an extremely expensive measure. To explore the possibility of controlling and suppressing the COVID-19 epidemic at the lowest possible cost, we apply optimal control theory. In this paper, we create two controlled Susceptible-Exposed-Infectious-Removed (SEIR) type models describing the spread of COVID-19 in a human population. For each model, we solve an optimal control problem and find the optimal quarantine strategy that ensures the minimal level of the infected population at the lowest possible cost. The properties of the corresponding optimal controls are established analytically using the Pontryagin maximum principle. The optimal solutions, obtained numerically, validate our analytical results. Additionally, for both controlled models, we find explicit formulas for the basic reproductive ratios in the presence of a constant control and show that while the epidemic can be eventually stopped under long-term quarantine measures of maximum strength (full lockdown), the strength of quarantine can be reduced under the optimal quarantine policies. The behavior of the appropriate optimal solutions and their dependence on the basic reproductive ratio, population density, and the duration of quarantine are discussed, and practically relevant conclusions are made.