A dynamic model of quality competition with endogenous prices