A constitutive model for masonry with internal variables