We consider the problem of shape optimization of nonlinear elastic solids i
n contact. The equilibrium of the solid is defined by a constrained minimiz
ation problem, where the body energy functional is the objective and the co
nstraints impose the nonpenetration condition. Then the optimization proble
m can be formulated in terms of a bilevel mathematical program. We describe
new optimality conditions for bilevel programming and construct an algorit
hm to solve these conditions based on Herskovits' feasible direction interi
or point method. With this approach we simultaneously carry out shape optim
ization and nonlinear contact analysis. That is, the present method is a "o
ne shot" technique. We describe some numerical examples solved in a very ef
ficient way.