Entanglement and quantum phase transitions in matrix-product spin-1 chains