Catalysis of the reaction: a protein L-lysine + a ubiquitin + ATP = a protein-N-ubiquityl-lysine + AMP + diphosphate. This reaction is the activation of the C-terminal carboxyl group of ubiquitin by the formation of a high-energy thiolester bond in an ATP-dependent manner.