First-order transition in small-world networks