Entanglement and Optimal Dense Coding in Spin Chain with an Arbitrary Magnetic Field