A geometric characterization of planar Sobolev extension domains