Phase transitions in four-dimensional AdS black holes with a nonlinear electrodynamics source