A Homogenized Model for the Nonlinear Behaviour of Masonry Under In-plane Loading