A man has pleaded not guilty to a charge of attempted murder after he was accused of stabbing a detective in a County Durham high-security prison.