We present a two-dimensional coarse-grained (CG) model for a lipid membrane composed of phospholipids and cholesterol. The effective CG interactions are determined using radial distribution functions (RDFs) from atom-scale molecular dynamics simulations using the inverse Monte Carlo (IMC) technique, based on our earlier work [T. Murtola et al., J. Chem. Phys.121, 9156 (2004); J. Chem. Phys.126, 075101 (2007)]. Here, the original model is improved by including an internal discrete degree of freedom for the phospholipid tails to describe chain ordering. We also discuss the problem of RDF inversion in the presence of internal states, in general, and present a modified IMC method for their inclusion. The new model agrees with the original models on large-scale structural features such as density fluctuations in pure dipalmitoylphosphocholine and cholesterol domain formation at intermediate concentrations and also indicates that ordered and disordered domains form at all cholesterol concentrations, even if the global density remains uniform. The inclusion of ordering also improves transferability of the interactions between different concentrations, but does not eliminate transferability problems completely. We also present a general discussion of problems related to RDF inversion.