A quasi-static model is proposed for the simulation of dense, randomly packed assemblies consisting of convex bodies and undergoing slow deformation. A second-order approximation of the contact conditions is first derived. The assembly equilibrium problem is formulated as a potential minimization problem subject to a set of nonlinear constraints that result from the impenetrability and sticking friction conditions. We find the solution of the nonlinear minimization problem through a sequence of approximation steps. At each step a quadratic programming subproblem is solved to compute a search direction along which a univariate nonsmooth minimization of the potential is performed. For the line search the nonlinear constraints are represented by exact penalty functions. The addition of a second-order correction step is shown to accelerate the algorithm. The paper concludes with a discussion of algorithm implementation issues and application examples.