Here are instructions for doing this in the Terminal. (Other answers you find are out of date, as they change every time Disk Utility’s UI changes, which is a lot.)
Before you begin, make sure to partition the USB drive as GPT and format it as Mac OS Extended (Journaled) (aka JHFS+).
Make a copy of the installer dmg:
$ cp "Install Mac OS X Lion.app/Contents/SharedSupport/InstallESD.dmg" ~
Scan the image to make it ready for restore
$ asr imagescan --source InstallESD.dmg
Checksumming partition of size 0 blocks...done
Checksumming partition of size 4 blocks...done
Block checksum: ....10....20....30....40....50....60....70....80....90....100
successfully scanned image "/Users/paul/InstallESD.dmg"
Restore the image to as USB drive
$ sudo asr --source InstallESD.dmg --target /Volumes/Untitled --erase --noprompt
Validating target...done
Validating source...done
Retrieving scan information...done
Validating sizes...done
Restoring ....10....20....30....40....50....60....70....80....90....100
Verifying ....10....20....30....40....50....60....70....80....90....100
Restored target device is /dev/disk6s2.
Remounting target volume...done
asr: Couldn't personalize volume /Volumes/Mac OS X Install ESD - State not recoverable