We consider a gravitating system consisting of a scalar field minimally coupled to gravity with a self-interacting potential and an U(1) electromagnetic field. Solving the coupled Einstein-Maxwell-scalar system we find exact hairy charged black hole solutions with the scalar field regular everywhere. We go to the zero temperature limit and we study the effect of the scalar field on the near horizon geometry of an extremal black hole. We find that except a critical value of the charge of the black hole there is also a critical value of the charge of the scalar field beyond of which the extremal black hole is destabilized. We study the thermodynamics of these solutions and we find that if the space is flat then at low temperature the Reissner-Nordstrom black hole is thermodynamically preferred, while if the space is AdS the hairy charged black hole is thermodynamically preferred at low temperature.