We consider the design of contests when the principal can choose both the prize profile and how the prizes are allocated as a function of a possibly noisy signal about the agents' efforts. We provide sufficient conditions that guarantee optimality of a contest. Optimal contests have a minimally competitive prize profile and an intermediate degree of competitiveness in the contest success function. Whenever observation is not too noisy, the optimum can be achieved by an all-pay contest with a cap. When observation is perfect, the optimum can also be achieved by a nested Tullock contest. We relate our results to a recent literature which has asked similar questions but has typically focused on the design of either the prize profile or the con...