We study the dynamics of opinion formation in a heterogeneous voter model on a complete graph, in which each agent is endowed with an integer fitness parameter k ≥ 0, in addition to its + or − opinion state. The evolution of the distribution of k–values and the opinion dynamics are coupled together, so as to allow the system to dynamically develop heterogeneity and memory in a simple way. When two agents with different opinions interact, their k–values are compared and, with probability p the agent with the lower value adopts the opinion of the one with the higher value, while with probability 1 − p the opposite happens. The winning agent then increments its k–value by one. We study the dynamics of the system in the entire 0 ≤ p ≤ 1 range and compare with the case p = 1/2, in which opinions are decoupled from the k–values and the dynamics is equivalent to that of the standard voter model. When 0 ≤ p < 1/2, agents with higher k–values are less persuasive, and the system approaches exponentially fast to the consensus state of the initial majority opinion. The mean consensus time τ appears to grow logarithmically with the number of agents N , and it is greatly decreased relative to the linear behavior τ ∼ N found in the standard voter model. When 1/2 < p ≤ 1, agents with higher k–values are more persuasive, and the system initially relaxes to a state with an even coexistence of opinions, but eventually reaches consensus by finite-size fluctuations. The approach to the coexistence state is monotonic for 1/2 < p < po 0.8, while for po ≤ p ≤ 1 there are damped oscillations around the coexistence value. The final approach to coexistence is approximately a power law t −b(p) in both regimes, where the exponent b increases with p. Also, τ increases respect to the standard voter model, although it still scales linearly with N. The p = 1 case is special, with a relaxation to coexistence that scales as t −2.73 and a consensus time that scales as τ ∼ N β , with β 1.45.