Williams denied the charge at Wolverhampton Crown Court on Thursday and was granted unconditional bail until his May 14 trial in the same court, the Press Association reported.
Co-defendant Jamien Nagadhana, who is also 31, denied a charge of assault by penetration in connection with the incident, PA reported.
Williams rose to fame as part of the four-piece British boy band JLS. The group finished as runners-up on “The X Factor” reality-TV show in 2008 before releasing five UK No. 1 singles.
He later embarked on a solo career, but announced he was suspending his charity work in the wake of his arrest, writing in a statement at the time: “Unfortunately the press speculation is likely to be unhelpful to the charities I work with.”