Contractibility and convexity