Entanglement in quantum-classical variational algorithms