A stochastic model for the cooperative relaxation of proteins, based on a hierarchy of interactions between amino acid residues