In this paper, we consider the electrical impedance tomography problem in a computational approach. This inverse problem is the recovery of the electrical conductivity $\sigma$ in a domain from boundary measurements, given in the form of the Neumann-to-Dirichlet map. We formulate the inverse problem as a variational one, with a fitting term and a regularization term. We restrict the minimization with respect to the unknown $\sigma$ to piecewise-constant functions defined on rectangular domains in two dimensions. We borrow image segmentation techniques to solve the minimization problem. Several experimental results of conductivity reconstruction from synthetic data are shown, with and without noise, that validate the proposed method.