Finite Element formulation for nonlinear analysis of masonry walls