Ferroelectric memristors are intensively studied due to their potential implementation in data storage and processing devices. In this work we show that the memristive behavior of metal-ferroelectricoxide-metal devices relies on the competition of two effects: the modulation of metal-ferroelectric interface barriers by the switchable ferroelectric polarization and the electromigration of oxygen vacancies, with the depolarizing field playing a fundamental role in the latter. We simulate our experimental results with a phenomenological model that includes both effects and we reproduce several nontrivial features of the electrical response, including resistance relaxations observed after external poling. Besides providing insight into the underlying physics of these complex devices, our work suggests that it is possible to combine nonvolatile and volatile resistive changes in single ferroelectric memristors, an issue that could be useful for the development of neuromorphic devices.