Suppose that f is a projective birational morphism with at most onedimensional fibres between d-dimensional varieties X and Y , satisfying Rf * O X = O Y . Consider the locus L in Y over which f is not an isomorphism. Taking the schemetheoretic fibre C over any closed point of L, we construct algebras A fib and Acon which prorepresent the functors of commutative deformations of C, and noncommutative deformations of the reduced fibre, respectively. Our main theorem is that the algebras Acon recover L, and in general the commutative deformations of neither C nor the reduced fibre can do this. As the d = 3 special case, this proves the following contraction theorem: in a neighbourhood of the point, the morphism f contracts a curve without contracting a divisor if and only if the functor of noncommutative deformations of the reduced fibre is representable.