We construct a stochastic model for maintenance suitable for the analysis of real-life systems which deteriorate over time before they eventually fail and are replaced. The model uses a continuous deterioration level, where the rate of change depends on the current operating mode as well as the current level of deterioration. We demonstrate how to construct a model in which the uncertainty about the state of deterioration, when the system is not continuously observed, is accurately represented. This feature addresses some drawbacks of previous work that is known to cause modelling errors. The key performance measures for this model can be evaluated efficiently using existing algorithms. The theory is illustrated using numerical examples, in which we discuss how this model can be used in a practical evaluation of different maintenance strategies.