A physical model for the electrical hysteresis of thin-film ferroelectric capacitors