We consider a variational problem with a polyconvex integrand and nonstandard boundary conditions that can be treated as minimization of the strain energy during the suturing process in the plastic surgery. Existence of minimizers is proved as well as necessary optimality conditions are discussed.