On a free boundary problem for minimal surfaces