A water-soluble copolymer comprising, by mass relative to the total mass of the copolymer: 5 to 45% of at least one cationic monomer whose cationicity comes exclusively from one or more quaternary ammonium functional groups; 50 to 95% of at least one monomer of formula (I); in which: R1 is a hydrogen atom or a methyl radical; Z is a divalent group —C(═O)—O—, or —C(═O)—NH—; n is an integer between 2 and 200; R2 is a hydrogen atom or a carbon-containing radical which is saturated or unsaturated, optionally aromatic, linear, branched or cyclic, comprising 1 to 30 carbon atoms, and from 0 to 4 heteroatoms chosen from the group comprising O, N and S; the copolymer having a cationic charge density of between 0.3 and 2.6 meq/g.