Two-dimensional lattice-fluid model with waterlike anomalies