An Implicit Contact Method for Tying Discrete Elastic Knots