String field theory and brane superpotentials