Ultrastrong coupling of a qubit with a nonlinear optical resonator