A credit contagion model for the dynamics of the rating transitions in a small- and medium-sized enterprises bank loan portfolio