Erceg et al. (2000) show that when both wages and prices are sticky, maximization of expected utility is equivalent to minimizing a loss function with three terms, involving measures of the variability of wage inflation, price inflation and the output gap respectively. Here we generalize their analysis, most importantly by not assuming the existence of output and employment subsidies that eliminate the distortions resulting from market power in goods and labour markets, so that the equilibrium level of output under flexible wages and prices would not necessarily be optimal. We show that a quadratic loss function can still be justified that involves the same three terms, albeit with different relative weights and a different definition of the output gap. Many conclusions of Erceg et al. are thus found to apply more generally. We argue, however, that in the presence of significant steady-state distortions, simple rules of the kind that they examine are likely to approximate optimal policy less closely than is suggested by their numerical results.