Entanglement and excited-state quantum phase transition in an extended Dicke model